<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>v-on指令1</title>
    <script src="js/vue.js"></script>
</head>
<body>
    <div id="app">
        <!---
            如果使用的是无参的函数，则可以带括号，也可以不带括号
        -->
        <button v-on:click="clickeMe()">按钮1</button>
        <button v-on:click="clickeMe2">按钮2</button>
        <hr>
        <button @mouseover="changebgColor('red')">变红色</button>
        <button @mouseover="changebgColor('green')">变绿色</button>
        <button @mouseover="changebgColor('sky')">变蓝色</button>
    </div>
</body>
</html>
<script>
    var vm=new Vue({
        el:'#app',
        methods: {
            clickeMe(){
                console.log("按钮1被执行了");
            },
            clickeMe2:function(){
                console.log("按钮2被执行了");
            },
            changebgColor(param){
                console.log(param);
                document.bgColor=param;
            }
        },
    });
</script>